let init = () => {
    initEvent()
}
let initEvent = function() {
    $('#loginBtn').on('click', onLoginBtnClick)
}
let onLoginBtnClick = async function() {
    let data = $('#loginForm').serializeArray()

    let resStatus = await userLogin(data)

    if (resStatus.code == 0) {
        sessionStorage.setItem('userToken', resStatus.token)
        location.replace('/')
    } else {
        alert(resStatus.errInfo)
    }
}


init()